<script>
function sendMessage(toUser) {
    toUser = toUser || '';
    Message.edit.add(toUser);
}

<php>
//获取报表报警参数
$tmpLocalConf     = include(APP_PATH . '../Public/Conf/local.php');
$tmpStatsWarnConf = array();
$tmpStatsWarnConfPre = 'stats_warn_conf_';
$tmpStatsWarnConfPreLen = strlen($tmpStatsWarnConfPre);

foreach($tmpLocalConf as $k => $v) {
    $tmpKey = strtolower($k);

    if(substr($tmpKey, 0, $tmpStatsWarnConfPreLen) == $tmpStatsWarnConfPre) {
        if(substr($tmpKey, -3) == '_op') { //忽略保存操作符的下标
            continue;
        }

        $newKey = str_replace($tmpStatsWarnConfPre, '', $tmpKey);

        if(is_null($v) || strlen($v) < 1) {
            continue;
        }

        $tmpStatsWarnConf[$newKey] = array($tmpLocalConf[$k . '_op'], (float)$v);
    }
}

</php>

var statsWarnConf = {:json_encode($tmpStatsWarnConf)};

function checkStatsWarn() {
    var groupKeyPre = 'g_';

    $.each(statsWarnConf, function(k, v) {
        var key = groupKeyPre + k,
            $o = $('[g=' + key + ']');

        $o.each(function(k2, v2){
            var $o2 = $(v2),
                code = $o2.html() + v[0] + v[1],
                result = eval(code);

                console.log(code + '=' + result);

            if(result) {
                var $td = $o2.parents('td'),
                    title = $td.attr('title') + v[0] + v[1] + '%';

                $o2.attr('title', title);
                $td.css('background-color', 'red');
            }
        }) 
    })
}

$(function(){
    var Config = {
        SITE_STATUS        : {$Think.config.SITE_STATUS|json_encode},
        REDIRECT_APP       : '{:C('REDIRECT_APP')}',
        LOGIN_URL          : '{:C('LOGIN_URL')}',
        LOGOUT_TO_URL      : '{:C('LOGOUT_TO_URL')}',
        USER_NAME_MIN_LEN  : {:C('USER_NAME_MIN_LEN')},
        USER_NAME_MAX_LEN  : {:C('USER_NAME_MAX_LEN')},
        PASSWD_MIN_LEN     : {:C('PASSWD_MIN_LEN')},
        PASSWD_MAX_LEN     : {:C('PASSWD_MAX_LEN')},
        CURRENT_USER_TYPE  : {:C('RUN_LOGIN_USER.type')},             //当前登陆会员的类型
        AD_TYPE            : {:json_encode(C('AD_TYPE'))},
        AD_STATUS          : {:json_encode(C('AD_STATUS'))},
        SITER_SERVICE_TYPE : 3,                                       //站长客服编号
        ADMIN_USER_TYPE    : 5                                        //管理员会员类型编号
    };

    <notempty name="searchJson"> 
    Conf.set('searchDao', {$searchJson});   //查询条件
    </notempty>

    Conf.set(Config);

    //Index.init();
    //User.init();
})
</script>
<script type="text/javascript" src="__RES__/js/init.js"></script>
<script type="text/javascript" src="__RES__/js/app.js"></script>
